home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / quicktip / quicktip.frm < prev    next >
Text File  |  1995-09-21  |  7KB  |  221 lines

  1. VERSION 2.00
  2. Begin Form Quick_Tip 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Quick Tip"
  6.    ClientHeight    =   3285
  7.    ClientLeft      =   1650
  8.    ClientTop       =   2115
  9.    ClientWidth     =   6315
  10.    Height          =   3690
  11.    Left            =   1590
  12.    LinkTopic       =   "Quick_Tip"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3285
  16.    ScaleWidth      =   6315
  17.    Top             =   1770
  18.    Width           =   6435
  19.    Begin CheckBox show_tip 
  20.       BackColor       =   &H00C0C0C0&
  21.       Caption         =   "Show Tips at Startup"
  22.       Height          =   255
  23.       Left            =   120
  24.       TabIndex        =   1
  25.       Top             =   3000
  26.       Value           =   1  'Checked
  27.       Width           =   3495
  28.    End
  29.    Begin CommandButton Quick_Tip_ 
  30.       Caption         =   "&Help"
  31.       Height          =   375
  32.       Left            =   4800
  33.       TabIndex        =   4
  34.       Top             =   1680
  35.       Width           =   1455
  36.    End
  37.    Begin CommandButton More_Tip_Button 
  38.       Caption         =   "&More Tips..."
  39.       Height          =   375
  40.       Left            =   4800
  41.       TabIndex        =   3
  42.       Top             =   1200
  43.       Width           =   1455
  44.    End
  45.    Begin CommandButton Next_Tip_Button 
  46.       Caption         =   "&Next Tip"
  47.       Height          =   375
  48.       Left            =   4800
  49.       TabIndex        =   2
  50.       Top             =   600
  51.       Width           =   1455
  52.    End
  53.    Begin CommandButton Quick_Tip_OK_Button 
  54.       Caption         =   "OK"
  55.       Default         =   -1  'True
  56.       Height          =   375
  57.       Left            =   4800
  58.       TabIndex        =   0
  59.       Top             =   120
  60.       Width           =   1455
  61.    End
  62.    Begin Image Image1 
  63.       Height          =   615
  64.       Left            =   360
  65.       Picture         =   QUICKTIP.FRX:0000
  66.       Top             =   250
  67.       Width           =   420
  68.    End
  69.    Begin Label Label1 
  70.       Caption         =   "Did You Know..."
  71.       Height          =   255
  72.       Left            =   840
  73.       TabIndex        =   5
  74.       Top             =   480
  75.       Width           =   1575
  76.    End
  77.    Begin Label tip_text 
  78.       Caption         =   "Tip Text...................."
  79.       Height          =   1695
  80.       Left            =   360
  81.       TabIndex        =   6
  82.       Top             =   960
  83.       Width           =   4095
  84.       WordWrap        =   -1  'True
  85.    End
  86.    Begin Shape Shape1 
  87.       BackColor       =   &H00FFFFFF&
  88.       FillColor       =   &H00FFFFFF&
  89.       FillStyle       =   0  'Solid
  90.       Height          =   2535
  91.       Left            =   240
  92.       Top             =   240
  93.       Width           =   4335
  94.    End
  95.    Begin Line Line4 
  96.       BorderColor     =   &H00FFFFFF&
  97.       X1              =   4680
  98.       X2              =   4680
  99.       Y1              =   2880
  100.       Y2              =   120
  101.    End
  102.    Begin Line Line3 
  103.       BorderColor     =   &H00808080&
  104.       X1              =   4680
  105.       X2              =   120
  106.       Y1              =   120
  107.       Y2              =   120
  108.    End
  109.    Begin Line Line2 
  110.       BorderColor     =   &H00FFFFFF&
  111.       X1              =   4680
  112.       X2              =   120
  113.       Y1              =   2880
  114.       Y2              =   2880
  115.    End
  116.    Begin Line Line1 
  117.       BorderColor     =   &H00808080&
  118.       X1              =   120
  119.       X2              =   120
  120.       Y1              =   120
  121.       Y2              =   2880
  122.    End
  123. End
  124. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal Section As String, ByVal Entry As String, ByVal DefaultValueEntry As String, ByVal ReturnedEntry As String, ByVal EntryValueSize As Integer, ByVal FileName As String) As Integer
  125. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal Section As String, ByVal Entry As String, ByVal EntryValue As String, ByVal FileName As String) As Integer
  126.  
  127. Dim current_tip As String
  128. Dim quick_ini As String
  129.  
  130. Sub Form_Load ()
  131.     tip_tex = ""
  132.     quick_ini = CurDir$ + "\QUICKTIP.INI"
  133.     start_tip = Trim(rtv_ini_data(quick_ini, "TIP", "START"))
  134.     
  135.     If start_tip = "T" Then
  136.         show_tip = 1
  137.     Else
  138.         show_tip = 0
  139.     End If
  140.  
  141.     load_tip
  142. End Sub
  143.  
  144. Sub load_tip ()
  145.     quick_ini = CurDir$ + "\QUICKTIP.INI"
  146.     current_tip = rtv_ini_data(quick_ini, "TIP", "CURRENT")
  147.     tip_text = rtv_ini_data(quick_ini, "TIP", current_tip)
  148.     current_tip = CStr(Val(current_tip) + 1)
  149.     error_check = rtv_ini_data(quick_ini, "TIP", current_tip)
  150.     If error_check = "unknown" Then
  151.         current_tip = "1"
  152.     End If
  153.     xx = upd_ini_data(quick_ini, "TIP", "CURRENT", current_tip)
  154. End Sub
  155.  
  156. Sub More_Tip_Button_Click ()
  157.     MsgBox "Place more Tip help under this button", 0
  158. End Sub
  159.  
  160. Sub Next_Tip_Button_Click ()
  161.     load_tip
  162. End Sub
  163.  
  164. Sub Quick_Tip__Click ()
  165.     MsgBox "Place your help under this button", 0
  166. End Sub
  167.  
  168. Sub Quick_Tip_OK_Button_Click ()
  169.     Dim start_tip As String
  170.     If show_tip Then
  171.         start_tip = "T"
  172.     Else
  173.         start_tip = "F"
  174.     End If
  175.     quick_ini = CurDir$ + "\QUICKTIP.INI"
  176.     xx = upd_ini_data(quick_ini, "TIP", "START", start_tip)
  177.     
  178.     End
  179.     'unload QUICKTIP
  180. End Sub
  181.  
  182. Function rtv_ini_data$ (ini_File$, ini_select$, ini_entry$)
  183.         ' rtv_ini_data("XXX.INI","ENVIRONMENT","PATH")
  184.         Dim temp_string As String
  185.         
  186.         rtv_ini_data$ = ""
  187.         
  188.         Section$ = ini_select$
  189.         Entry$ = ini_entry$
  190.         DefaultValue$ = "unknown"
  191.         EntryValue$ = Space$(1000)
  192.         EntryValueSize = 1000
  193.         
  194.         x% = GetPrivateProfileString(Section$, Entry$, DefaultValue$, EntryValue$, EntryValueSize, ini_File$)
  195.         If x% = 0 Then
  196.             box_msg$ = " Invalid Entry -> " + Section$ + "/" + Entry$
  197.             MsgBox box_msg$, 16, "Loading Error"
  198.         End If
  199.         
  200.         Len_string = Len(Trim$(EntryValue$)) - 1
  201.         temp_string = Left$(EntryValue$, Len_string)
  202.         rtv_ini_data$ = temp_string
  203. End Function
  204.  
  205. Function upd_ini_data$ (ini_File$, ini_select$, ini_entry$, EntryValue$)
  206.         ' upd_ini_data("XXX.INI","ENVIRONMENT","PATH", "C:\")
  207.         
  208.         upd_ini_data$ = ""
  209.         
  210.         Section$ = ini_select$
  211.         Entry$ = ini_entry$
  212.         
  213.         x% = WritePrivateProfileString(Section$, Entry$, EntryValue$, ini_File$)
  214.         If x% = 0 Then
  215.             box_msg$ = " Invalid Entry -> " + Section$ + "/" + Entry$
  216.             MsgBox box_msg$, 16, "Loading Error"
  217.         End If
  218.         
  219. End Function
  220.  
  221.